﻿using System;
using System.Collections.Generic;
using System.Text;
using Chloe;
using lingopen.Entity.WF;

namespace lingopen.Application.WF.Implements
{
    public class DiagramApplicationService : AdminAppService, IWFAppService
    {
        public PagedData<WF_Diagram> GetDiagrams(Pagination pagination, string keyword)
        {
            var q = this.DbContext.Query<WF_Diagram>().FilterDeleted();
            q = q.WhereIfNotNullOrEmpty(keyword, p => p.Name.Contains(keyword) || p.Code.Contains(keyword));
            q.OrderBy(p => p.Code);
            var pagedData = q.TakePageData(pagination);
            return pagedData;
        }
    }
}
